#include "aboutmepage.h"
#include "ui_aboutmepage.h"
#include "qpainter.h"
#include "qsettings.h"
#include "constant.h"
AboutMePage::AboutMePage(QWidget *parent) :
    QWidget(parent),
    ui(new Ui::AboutMePage)
{
    ui->setupUi(this);
    //读取ini
    QSettings settingsread("Option.ini",QSettings::IniFormat);
    QString Name = settingsread.value("DevOption/Name").toString();
    ui->login_lineEdit_dw->setText(Name);
    if(Constant::ShowFullScreen)
        this->showFullScreen();
}

AboutMePage::~AboutMePage()
{
    delete ui;
}
void AboutMePage::paintEvent(QPaintEvent *event)
{
    //通过这种方式可以将图片平铺到窗口上
    //使用样式表可以很方便设置界面，而且非常高效，还能让界面和逻辑分离
    //不过在本例中由于是顶层窗口，所以直接设置样式表也不会显示。
    //所以样式表比较适合子窗口来使用。
    QPainter painter(this);
    painter.drawPixmap(rect(),QPixmap(":/images/share/selectmodel_page_bg2.png"),QRect());
}




void AboutMePage::on_pushButton_exit_clicked()
{
    this->close();
}


void AboutMePage::on_pushButton_OK_clicked()
{
    QSettings settings("Option.ini",QSettings::IniFormat);
    settings.beginGroup("DevOption"); //
    settings.setValue("Name",ui->login_lineEdit_dw->text());
    settings.endGroup();
    this->close();

}

